package net.ib.mtalk.database;

import android.net.Uri;
import android.provider.BaseColumns;

public class DatabaseContract {
	
	public static final String CONTENT_AUTHORITY 			= "net.ib.mtalk.provider";
	
	private static final Uri BASE_CONTENT_URI 				= Uri.parse("content://" + CONTENT_AUTHORITY);
	
	public static final Uri AUTHORITY_URI					= BASE_CONTENT_URI;
	
	public interface MTalkBaseColumns extends BaseColumns {
		public static final String KEY_CNT											= "cnt";
	}
	
	interface BuddyColumns {
		/** Buddy Table 의 Buddy uuid msb */
		public static final String KEY_BUDDY_UUID_MSB								= "buddy_uuid_msb";
		/** Buddy Table 의 Buddy uuid lsb */
		public static final String KEY_BUDDY_UUID_LSB								= "buddy_uuid_lsb";
		/** Buddy Table 의 Buddy status type */ 
		public static final String KEY_BUDDY_STATUS_TYPE							= "buddy_status_type";
		/** Buddy Table 의 Buddy favorite */
		public static final String KEY_BUDDY_FAVORITE								= "buddy_favorite";
		/** Buddy Table 의 buddyinfo */
		public static final String KEY_BUDDY_INFO 									= "buddy_info";
		/** Buddy Table 의 Display name */
		public static final String KEY_BUDDY_DISPLAYNAME							= "buddy_displayname";
		/** Buddy Table 의 Display nick */
		public static final String KEY_BUDDY_DISPLAYNICK							= "buddy_displaynick";
		/** Buddy Table 의 Buddy new_friend */
		public static final String KEY_BUDDY_NEW_FRIEND								= "buddy_new_friend";
		/** Buddy Table 의 Name chosung */
		public static final String KEY_BUDDY_CHOSUNG								= "buddy_chosung";
		/** Buddy Table 의 Img Version */
		public static final String KEY_BUDDY_IMG_VERSION							= "buddy_img_version";
	}
	
	interface GroupColumns {
		/** Group Table 의 Group Name */
		public static final String KEY_GROUP_NAME					= "group_name";
		/** Group Table 의 fold/unfold */
		public static final String KEY_GROUP_SET_FOLD				= "group_set_fold";
		/** Group Table 의 count */
//		public static final String KEY_GROUP_COUNT					= "group_count";
		/** Group Table 의 participant_msb */
//		public static final String KEY_PARTICIPANT_MSB				= "participant_msb";
		/** Group Table 의 participant_lsb */
//		public static final String KEY_PARTICIPANT_LSB				= "participant_lsb";
	}
	
	interface ContactColumns {
		/** Contact Table 의 contact contact phone id */
		public static final String KEY_CONTACT_PHONE_ID				= "contact_phone_id";
		/** Contact Table 의 contact number */
		public static final String KEY_CONTACT_NUMBER				= "contact_number";
		/** Contact Table 의 contact identifier */
		public static final String KEY_CONTACT_IDENTIFIER			= "contact_identifier";
		/** Contact Table 의 contact group */
//		public static final String KEY_CONTACT_GROUP				= "contact_group";
		/** Contact Table 의 contact version */
		public static final String KEY_CONTACT_VERSION				= "contact_version";
		/** Contact Table 의 contact type */
		public static final String KEY_CONTACT_TYPE					= "contact_type";
		/** Contact Table 의 contact name */
		public static final String KEY_CONTACT_NAME					= "contact_name";
		/** Contact Table 의 buddy uuid msb */
		public static final String KEY_BUDDY_UUID_MSB				= "buddy_uuid_msb";
		/** Contact Table 의 buddy uuid lsb */
		public static final String KEY_BUDDY_UUID_LSB				= "buddy_uuid_lsb";
	}
	
	interface ParticipantsColumns {
		/** Participants Table 의 Group ID */
		public static final String KEY_PARTICIPANTS_GROUP			= "group_participants_group";
		/** Participants Table 의 Buddy ID */
		public static final String KEY_PARTICIPANTS_BUDDY			= "group_participants_buddy";
	}
	
	interface MessageColumns {
		/** Message Table 의 client view uuid msb */
		public static final String KEY_CLIENT_VIEW_UUID_MSB			= "client_view_uuid_msb";
		/** Message Table 의 client view uuid lsb */
		public static final String KEY_CLIENT_VIEW_UUID_LSB			= "client_view_uuid_lsb";
		/** Message Table 의 view uuid msb */
		public static final String KEY_VIEW_UUID_MSB				= "view_uuid_msb";
		/** Message Table 의 view uuid lsb */
		public static final String KEY_VIEW_UUID_LSB				= "view_uuid_lsb";
		/** Message Table 의 client message uuid msb */
		public static final String KEY_CLIENT_MESSAGE_UUID_MSB		= "client_msg_uuid_msb";
		/** Message Table 의 client message uuid lsb */
		public static final String KEY_CLIENT_MESSAGE_UUID_LSB		= "client_msg_uuid_lsb";
		/** Message Table 의 message uuid msb */
		public static final String KEY_MESSAGE_UUID_MSB				= "msg_uuid_msb";
		/** Message Table 의 message uuid lsb */
		public static final String KEY_MESSAGE_UUID_LSB				= "msg_uuid_lsb";
		/** Message Table 의 message noti uuid msb */
		public static final String KEY_MESSAGE_NOTI_UUID_MSB		= "msg_noti_uuid_msb";
		/** Message Table 의 message noti uuid lsb */
		public static final String KEY_MESSAGE_NOTI_UUID_LSB		= "msg_noti_uuid_lsb";
		/** Message Table 의 메시지 생성시간 (from Server) */
		public static final String KEY_MESSAGE_TIME					= "msg_time";
		/** Message Table 의 메시지 상태 */
		public static final String KEY_MESSAGE_STATUS		 		= "msg_status";
		/** Message Table 의 object type */
		public static final String KEY_MESSAGE_OBJECT_TYPE			= "msg_object_type";
		/** Message Table 의 메시지 발송 여부 */
		public static final String KEY_SEND_MESSAGE					= "send_message";
		/** Message Table 의 메시지의 성격(TEXT,IMAGE 등) */
		public static final String KEY_MESSAGE_PROPERTY				= "msg_prop";
		/** Message Table 의 첨부파일 URI */
		public static final String KEY_FILE_URI						= "file_uri";
		/** Message Table 의 첨부파일 FILE_INFO */
		public static final String KEY_FILE_TRANSFER_INFO			= "file_transfer_info";
		/** Message Table 의 메시지 Message */
		public static final String KEY_MESSAGE 						= "msg";
		/** Message Table 의 Thumbnail 정보 */
		public static final String KEY_THUMBNAIL					= "thumb_nail";
		/** Message Tabel 의 Message UnReadCount */
		public static final String KEY_MESSAGE_UNREAD_COUNT			= "message_unread_count";
	}
	
	interface ViewColumns {
		/** View Table 의 client view uuid msb */
		public static final String KEY_CLIENT_VIEW_UUID_MSB			= "client_view_uuid_msb";
		/** View Table 의 client view uuid lsb */
		public static final String KEY_CLIENT_VIEW_UUID_LSB			= "client_view_uuid_lsb";
		/** View Table 의 view uuid msb */
		public static final String KEY_VIEW_UUID_MSB				= "view_uuid_msb";
		/** View Table 의 view uuid lsb */
		public static final String KEY_VIEW_UUID_LSB				= "view_uuid_lsb";
		/** View Table 의 receiver uuid msb */
		public static final String KEY_RECEIVER_UUID_MSB			= "receiver_uuid_msb";
		/** View Table 의 receiver uuid lsb */
		public static final String KEY_RECEIVER_UUID_LSB			= "receiver_uuid_lsb";
		/** View Table 의 chat type */
		public static final String KEY_CHAT_TYPE					= "chat_type";
		/** View Table 의 제목 */
		public static final String KEY_TITLE 						= "title";
		/** View Table 의 lastMessage */
		public static final String KEY_SUB_TITLE					= "sub_title";
		/** View Table 의 마지막 메시지 발송, 수신 시간 */
		public static final String KEY_MESSAGE_LAST_TIME			= "view_last_time";
		/** View Table 의 unread_count */
		public static final String KEY_VIEW_UNREAD_COUNT			= "view_unread_count";
		/** View Table 의 member_count */
		public static final String KEY_VIEW_MEMBER_COUNT			= "view_member_count";
		/** View Table 의 push on/off */
		public static final String KEY_VIEW_PUSH_ONOFF				= "view_push_onoff";
		/** View Table 의 enable */
		public static final String KEY_VIEW_ENABLE					= "view_enable";
		/** View Table 의 receiver_list */
		public static final String KEY_RECEIVER_LIST				= "receiver_list";
		
		
		/** View Table 의 Message TRIGGER */
		/** View Table 의 Message TRIGGER INSERT */
		public static final String TRIGGER_MESSAGES_INSERT			= "view_messages_insert";
		/** View Table 의 Message TRIGGER UPDATE */
		public static final String TRIGGER_MESSAGES_UPDATE			= "view_messages_update";
		/** View Table 의 Message TRIGGER DELETE */
		public static final String TRIGGER_MESSAGES_DELETE			= "view_messages_delete";
		
	}
	
	interface ViewMemberColumns {
		public static final String KEY_VIEW_UUID_MSB				= "view_uuid_msb";
		public static final String KEY_VIEW_UUID_LSB				= "view_uuid_lsb";
		public static final String KEY_BUDDY_UUID_MSB				= "buddy_uuid_msb";
		public static final String KEY_BUDDY_UUID_LSB				= "buddy_uuid_lsb";
		public static final String KEY_BUDDY_NAME					= "buddy_name";
	}
	
	interface SuggestionColumns {
		/** Suggestion Table 의 suggestion uuid msb */
		public static final String KEY_SUGGESTION_UUID_MSB				= "suggestion_uuid_msb";
		/** Suggestion Table 의 suggestion uuid lsb */
		public static final String KEY_SUGGESTION_UUID_LSB				= "suggestion_uuid_lsb";
		/** Suggestion Table 의 score */
		public static final String KEY_SCORE							= "suggestion_score";
		/** Suggestion Table 의 knows_options */
		public static final String KEY_KNOWS_OPTIONS					= "knows_options";
		/** Suggestion Table 의 mutual_options */
		public static final String KEY_MUTUAL_OPTIONS					= "mutual_options";
		/** Suggestion Table 의 status type */
		public static final String KEY_STATUS_TYPE						= "status_type";
		/** Suggestion Table 의 DisplayName */
		public static final String KEY_DISPLAYNAME						= "display_name";
	}

	interface ProfileColumns {
		/** Profile Table 의 profile uuid msb */
		public static final String KEY_PROFILE_UUID_MSB					= "profile_uuid_msb";
		/** Profile Table 의 profile uuid lsb */
		public static final String KEY_PROFILE_UUID_LSB					= "profile_uuid_lsb";
		/** Profile Table 의 upload 여부 */
		public static final String KEY_IS_UPLOAD						= "is_upload";
		/** Profile Table 의 첨부파일 FILE_TRANSFER_INFO */
		public static final String KEY_FILE_TRANSFER_INFO				= "file_transfer_info";
		/** Profile Table 의 첨부파일 FILE_OPTIONS */
		public static final String KEY_FILE_OPTIONS						= "file_options";
	}
	
	public static class BuddyTable implements BuddyColumns, BaseColumns {
		public static final String PATH_NOT_GROUP		=	"not_group";
		public static final String PATH_UNION			=	"union";
		public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon().appendPath("buddy").build();
		public static final String CONTENT_TYPE = "vnd.mtalk.cursor.dir/vnd.mtalk.buddy";
		public static final String CONTENT_ITEM_TYPE = "vnd.mtalk.cursor.item/vnd.mtalk.buddy";
		public static Uri buildBuddyUri(String buddyId) {
			return CONTENT_URI.buildUpon().appendPath(buddyId).build();
		}
		public static Uri buildBuddyNotGroupUri() {
			return CONTENT_URI.buildUpon().appendPath(PATH_NOT_GROUP).build();
		}
		public static Uri buildBuddyUnionUri() {
			return CONTENT_URI.buildUpon().appendPath(PATH_UNION).build();
		}
		public static String getBuddyID(Uri uri) {
			return uri.getPathSegments().get(1);
		}
		public static String getBuddyUUIDMSB(Uri uri) {
			return uri.getPathSegments().get(2);
		}
		public static String getBuddyUUIDLSB(Uri uri) {
			return uri.getPathSegments().get(3);
		}
		public static String getBuddyStatusType(Uri uri){
			return uri.getPathSegments().get(4);
		}
		public static String getBuddyInfo(Uri uri) {
			return uri.getPathSegments().get(5);
		}
		public static String getNewFriend(Uri uri) {
			return uri.getPathSegments().get(6);
		}
		public static String getChosung(Uri uri) {
			return uri.getPathSegments().get(7);
		}
		public static String getImgVersion(Uri uri) {
			return uri.getPathSegments().get(8);
		}
		
		public static final String[] PROJECTION = new String[] {
			BuddyTable._ID, BuddyTable.KEY_BUDDY_UUID_MSB, BuddyTable.KEY_BUDDY_UUID_LSB, BuddyTable.KEY_BUDDY_STATUS_TYPE, 
			BuddyTable.KEY_BUDDY_FAVORITE, BuddyTable.KEY_BUDDY_INFO, BuddyTable.KEY_BUDDY_DISPLAYNAME, BuddyTable.KEY_BUDDY_DISPLAYNICK,
			BuddyTable.KEY_BUDDY_NEW_FRIEND, BuddyTable.KEY_BUDDY_CHOSUNG
		};
	}
	
	public static class GroupTable implements GroupColumns, BaseColumns {
		public static final String PATH_BUDDY_INFO		=	"buddy_info";
		public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon().appendPath("phone_group").build();
		public static final String CONTENT_TYPE = "vnd.mtalk.cursor.dir/vnd.mtalk.group";
		public static final String CONTENT_ITEM_TYPE = "vnd.mtalk.cursor.item/vnd.mtalk.group";
		public static Uri buildGroupUri(String groupId) {
			return CONTENT_URI.buildUpon().appendPath(groupId).build();
		}
		public static Uri buildBuddyInfoUri() {
			return CONTENT_URI.buildUpon().appendPath(PATH_BUDDY_INFO).build();
		}
		public static String getGroupID(Uri uri) {
			return uri.getPathSegments().get(1);
		}
		public static String getGroupName(Uri uri) {
			return uri.getPathSegments().get(2);
		}
		public static String getGroupSetFold(Uri uri) {
			return uri.getPathSegments().get(3);
		}
//		public static String getParticipantMsb(Uri uri) {
//			return uri.getPathSegments().get(3);
//		}
//		public static String getParticipantLsb(Uri uri) {
//			return uri.getPathSegments().get(4);
//		}
		
		public static final String[] PROJECTION = new String[] {
			GroupTable._ID, GroupTable.KEY_GROUP_NAME,	GroupTable.KEY_GROUP_SET_FOLD 
//			GroupTable.KEY_PARTICIPANT_MSB, GroupTable.KEY_PARTICIPANT_LSB
		};
	}
	
	public static class ContactTable implements ContactColumns, BaseColumns {
		public static final String PATH_CONTACT_BUDDY		=	"contact_buddy";
		public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon().appendPath("contact").build();
		public static final String CONTENT_TYPE = "vnd.mtalk.cursor.dir/vnd.mtalk.contact";
		public static final String CONTENT_ITEM_TYPE = "vnd.mtalk.cursor.item/vnd.mtalk.contact";
		public static Uri buildContactUri(String contactId) {
			return CONTENT_URI.buildUpon().appendPath(contactId).build();
		}
		public static Uri buildContactBuddy() {
			return CONTENT_URI.buildUpon().appendPath(PATH_CONTACT_BUDDY).build();
		}
		public static String getContactID(Uri uri) {
			return uri.getPathSegments().get(1);
		}
		public static String getContactPhoneId(Uri uri) {
			return uri.getPathSegments().get(2);
		}
		public static String getContactNumber(Uri uri) {
			return uri.getPathSegments().get(3);
		}
		public static String getContactIdentifier(Uri uri) {
			return uri.getPathSegments().get(4);
		}
		public static String getContactType(Uri uri) {
			return uri.getPathSegments().get(5);
		}
		public static String getContactVersion(Uri uri) {
			return uri.getPathSegments().get(6);
		}
		public static String getContactName(Uri uri) {
			return uri.getPathSegments().get(7);
		}
		public static String getBuddyUUIDMsb(Uri uri) {
			return uri.getPathSegments().get(8);
		}
		public static String getBuddyUUIDLsb(Uri uri) {
			return uri.getPathSegments().get(9);
		}
		public static final String[] PROJECTION = new String[] {
			ContactTable._ID, ContactTable.KEY_CONTACT_PHONE_ID, 
			ContactTable.KEY_CONTACT_NUMBER, ContactTable.KEY_CONTACT_IDENTIFIER, ContactTable.KEY_CONTACT_TYPE, 
			ContactTable.KEY_CONTACT_VERSION, ContactTable.KEY_BUDDY_UUID_MSB, ContactTable.KEY_BUDDY_UUID_LSB
		};
		
	}
	
	public static class ParticipantsTable implements ParticipantsColumns, BaseColumns {
		public static final String PATH_GROUP		=	"group";
		
		public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon().appendPath("participants").build();
		public static final String CONTENT_TYPE = "vnd.mtalk.cursor.dir/vnd.mtalk.participants";
		public static final String CONTENT_ITEM_TYPE = "vnd.mtalk.cursor.item/vnd.mtalk.participants";
		public static Uri buildContactUri(String participantsId) {
			return CONTENT_URI.buildUpon().appendPath(participantsId).build();
		}
		public static Uri buildBuddyGroupUri() {
			return CONTENT_URI.buildUpon().appendPath(PATH_GROUP).build();
		}
		public static String getParticipantsID(Uri uri) {
			return uri.getPathSegments().get(1);
		}
		public static String getParticipantsGroupId(Uri uri) {
			return uri.getPathSegments().get(2);
		}
		public static String getParticipantsBuddyId(Uri uri) {
			return uri.getPathSegments().get(3);
		}
		
		public static final String[] PROJECTION = new String[] {
			ParticipantsTable._ID, ParticipantsTable.KEY_PARTICIPANTS_GROUP, ParticipantsTable.KEY_PARTICIPANTS_BUDDY
		};
	}
	
	public static class MessageTable implements MessageColumns, BaseColumns {
		public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon().appendPath("msg").build();
		public static final String CONTENT_TYPE = "vnd.mtalk.cursor.dir/vnd.mtalk.message";
		public static final String CONTENT_ITEM_TYPE = "vnd.mtalk.cursor.item/vnd.mtalk.message";
		public static Uri buildMessageUri(String contactId) {
			return CONTENT_URI.buildUpon().appendPath(contactId).build();
		}
		public static String getMessageID(Uri uri) {
			return uri.getPathSegments().get(1);
		}
		public static String getMessageClientUUIDMSB(Uri uri){
			return uri.getPathSegments().get(2);
		}
		public static String getMessageClientUUIDLSB(Uri uri){
			return uri.getPathSegments().get(3);
		}
		public static String getMessageUUIDMSB(Uri uri) {
			return uri.getPathSegments().get(4);
		} 
		public static String getMessageUUIDLSB(Uri uri) {
			return uri.getPathSegments().get(5);
		} 
		public static final String[] PROJECTION = new String[] {
			MessageTable._ID,
			MessageTable.KEY_CLIENT_VIEW_UUID_MSB, MessageTable.KEY_CLIENT_VIEW_UUID_LSB,
			MessageTable.KEY_VIEW_UUID_MSB, MessageTable.KEY_VIEW_UUID_LSB,
			MessageTable.KEY_CLIENT_MESSAGE_UUID_MSB, MessageTable.KEY_CLIENT_MESSAGE_UUID_LSB,
			MessageTable.KEY_MESSAGE_UUID_MSB, MessageTable.KEY_MESSAGE_UUID_LSB,
			MessageTable.KEY_MESSAGE_NOTI_UUID_MSB, MessageTable.KEY_MESSAGE_NOTI_UUID_LSB,
			MessageTable.KEY_MESSAGE_TIME, MessageTable.KEY_MESSAGE_STATUS,
			MessageTable.KEY_MESSAGE_OBJECT_TYPE, MessageTable.KEY_SEND_MESSAGE,
			MessageTable.KEY_FILE_TRANSFER_INFO, MessageTable.KEY_MESSAGE,
			MessageTable.KEY_THUMBNAIL, MessageTable.KEY_MESSAGE_UNREAD_COUNT };

		/** MessageTable.message_status에 사용하는 값 */
		public enum MessageStatus{
			SENDING,
			SERVER_RECEIVE,
			CLIENT_RECEIVE,
			SERVER_RECEIVE_FAIL
		}
		/** MessageTable.object_type에 사용하는 값 */
		public enum MessageObjectType{
			USER(1),
			SYSTEM(2),
			CONTROL(3);
			int code = 1;
			MessageObjectType(int i){
				code = i;
			}
			public int getCode(){
				return this.code;
			}
		}
		/** MessageTable.is_send_message 에 사용하는 값 */
		public enum SendMessage{
			NO,
			YES
			
		}
		/** MessageTable.msg_prop 에 사용하는 값 */
		public enum MessageProperty{
			TEXT,
			IMAGE,
			RECORD,
			VIDEO,
			GEOTAG,
			CONTACT,
			CALENDAR,
			GIFT
		}
	}
	
	public static class ViewTable implements ViewColumns, BaseColumns {
		public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon().appendPath("view").build();
		public static final String CONTENT_TYPE = "vnd.mtalk.cursor.dir/vnd.mtalk.view";
		public static final String CONTENT_ITEM_TYPE = "vnd.mtalk.cursor.item/vnd.mtalk.view";
		public static Uri buildViewUri(String contactId) {
			return CONTENT_URI.buildUpon().appendPath(contactId).build();
		}
		public static String getViewID(Uri uri) {
			return uri.getPathSegments().get(1);
		}
		public static String getViewClientUUIDMSB(Uri uri){
			return uri.getPathSegments().get(2);
		}
		public static String getViewClientUUIDLSB(Uri uri){
			return uri.getPathSegments().get(3);
		}
		public static String getViewUUIDMSB(Uri uri) {
			return uri.getPathSegments().get(4);
		}
		public static String getViewUUIDLSB(Uri uri) {
			return uri.getPathSegments().get(5);
		}
		public static String getReceiverMsb(Uri uri) {
			return uri.getPathSegments().get(6);
		}
		public static String getReceiverLsb(Uri uri) {
			return uri.getPathSegments().get(7);
		}

		public static final String[] PROJECTION = new String[] {
			ViewTable._ID, 
			ViewTable.KEY_CLIENT_VIEW_UUID_MSB, ViewTable.KEY_CLIENT_VIEW_UUID_LSB,	
			ViewTable.KEY_VIEW_UUID_MSB, ViewTable.KEY_VIEW_UUID_LSB, 
			ViewTable.KEY_RECEIVER_UUID_MSB, ViewTable.KEY_RECEIVER_UUID_LSB, 
			ViewTable.KEY_CHAT_TYPE, ViewTable.KEY_TITLE, ViewTable.KEY_SUB_TITLE,
			ViewTable.KEY_VIEW_UNREAD_COUNT, ViewTable.KEY_VIEW_MEMBER_COUNT,
			ViewTable.KEY_MESSAGE_LAST_TIME, ViewTable.KEY_VIEW_PUSH_ONOFF, 
			ViewTable.KEY_VIEW_ENABLE, ViewTable.KEY_RECEIVER_LIST };
		
		public enum PushType{
			OFF,
			ON
		}
		
		public enum ChatType{
//			1:ONE_TO_ONE 2:MULTI 3:BROAD 4:GROUP
			ONE_TO_ONE(1),
			MULTI(2),
			BROAD(3),
			GROUP(4);
			int code = 1;
			ChatType(int i){
				code = i;
			}
			public int getCode(){
				return this.code;
			}
		}
		
		public enum EnableType{
			DISABLE,
			ENABLE,
			LEAVE
		}
	}
	
	public static class ViewMembersTable implements ViewMemberColumns, BaseColumns {
		public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon().appendPath("view_members").build();
		public static final String CONTENT_TYPE = "vnd.mtalk.cursor.dir/vnd.mtalk.view_members";
		public static final String CONTENT_ITEM_TYPE = "vnd.mtalk.cursor.item/vnd.mtalk.view_members";
		public static Uri buildViewMembersUri(String contactId){
			return CONTENT_URI.buildUpon().appendPath(contactId).build();
		}
		public static String getViewMembersID(Uri uri){
			return uri.getPathSegments().get(1);
		}
		public static final String[] PROJECTION = new String[]{
			ViewMembersTable._ID, ViewMembersTable.KEY_VIEW_UUID_LSB, 
			ViewMembersTable.KEY_VIEW_UUID_MSB,	ViewMembersTable.KEY_BUDDY_UUID_LSB, 
			ViewMembersTable.KEY_BUDDY_UUID_MSB, ViewMembersTable.KEY_BUDDY_NAME
		};
	}
	
	public static class SuggestionTable implements SuggestionColumns, BaseColumns {
		public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon().appendPath("suggestion").build();
		public static final String CONTENT_TYPE = "vnd.mtalk.cursor.dir/vnd.mtalk.suggestion";
		public static final String CONTENT_ITEM_TYPE = "vnd.mtalk.cursor.item/vnd.mtalk.suggestion"; 
		public static Uri buildSuggestionUri(String contactId) {
			return CONTENT_URI.buildUpon().appendPath(contactId).build();
		}
		public static String getSuggestionID(Uri uri) {
			return uri.getPathSegments().get(1);
		}
		public static String getSuggestionUUIDMSB(Uri uri) {
			return uri.getPathSegments().get(2);
		}
		public static String getSuggestionUUIDLSB(Uri uri) {
			return uri.getPathSegments().get(3);
		}
		public static String getSuggestionStatusType(Uri uri) {
			return uri.getPathSegments().get(4);
		}
		public static String getSuggestionDisplayName(Uri uri) {
			return uri.getPathSegments().get(5);
		}
		public static final String[] PROJECTION = new String[]{
			SuggestionTable._ID, SuggestionTable.KEY_SUGGESTION_UUID_MSB, SuggestionTable.KEY_SUGGESTION_UUID_LSB,
			SuggestionTable.KEY_SCORE,	SuggestionTable.KEY_KNOWS_OPTIONS, SuggestionTable.KEY_MUTUAL_OPTIONS, 
			SuggestionTable.KEY_STATUS_TYPE, SuggestionTable.KEY_DISPLAYNAME
		};
	}

	public static class ProfileTable implements ProfileColumns, BaseColumns {
		public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon().appendPath("profile").build();
		public static final String CONTENT_TYPE = "vnd.mtalk.cursor.dir/vnd.mtalk.profile";
		public static final String CONTENT_ITEM_TYPE = "vnd.mtalk.cursor.item/vnd.mtalk.profile"; 
		public static Uri buildProfileUri(String contactId) {
			return CONTENT_URI.buildUpon().appendPath(contactId).build();
		}
		public static String getProfileID(Uri uri) {
			return uri.getPathSegments().get(1);
		}
		public static String getProfileUUIDMSB(Uri uri) {
			return uri.getPathSegments().get(2);
		}
		public static String getProfileUUIDLSB(Uri uri) {
			return uri.getPathSegments().get(3);
		}
		public static final String[] PROJECTION = new String[]{
			ProfileTable._ID, ProfileTable.KEY_PROFILE_UUID_MSB, ProfileTable.KEY_PROFILE_UUID_LSB,
			ProfileTable.KEY_IS_UPLOAD,	ProfileTable.KEY_FILE_TRANSFER_INFO, ProfileTable.KEY_FILE_OPTIONS 
		};
	}
	
}
